<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编写函数has(arr , 60) 判断数组中是否存在60这个元素，返回布尔类型</title>
</head>

<body>

</body>
<script>
    var arr = [1, 2, 3, 60];

    function has(item, val) {
        if (item.indexOf(val) == -1) {
            return false;
        } else {
            return true;
        }
    }

    console.log(has(arr, 1))
</script>

</html>